<template>
  <div>
    <card
      :title="title"
      :headstyle="cardstyle"
      :class="initAnchorInfo"
      shadow="nerver"
    >
      <PublicTable
        ref="table1"
        :loading="false"
        :table-data="info"
        :columns="columns"
        :options="options"
      />
      <div class="zy_title">质量写实记录</div>
      <PublicTable
        ref="table1"
        :loading="false"
        :table-data="zyinfo"
        :columns="zycolumns"
        :options="options"
      />
      <div class="zy_title">挖坑记录</div>
      <PublicTable
        ref="table1"
        :loading="false"
        :table-data="shipinfo"
        :columns="shipcolumns"
        :options="options"
      />
      <!-- <div class="zy_title">出库方式</div>
      <PublicTable
        ref="table1"
        :loading="false"
        :table-data="tginfo"
        :columns="tgcolumns"
        :options="options"
      /> -->
      <!-- <div class="zy_title">质量上报</div>
      <PublicTable
        ref="table1"
        :loading="false"
        :table-data="zyinfo"
        :columns="tgcolumns"
        :options="options"
      /> -->
    </card>
  </div>
</template>

<script>
const columns = [
  {
    label: "卸船日期",
    prop: "XCRQ",
    // minwidth: "110",
  },
  {
    label: "出清日期",
    prop: "STATDATE_OVER",
    // minwidth: "140",
  },
  {
    label: "堆存天数",
    prop: "DCTS",
    // minwidth: "140",
  },
  {
    label: "入库吨",
    prop: "INTONS",
    // minwidth: "140",
  },
  {
    label: "出库吨",
    prop: "OUTTONS",
    // minwidth: "140",
  },
  {
    label: "盈亏吨",
    prop: "EARNINGTONS",
    // minwidth: "90",
  },
  {
    label: "盈亏吨率",
    prop: "YKDL",
    // minwidth: "90",
  },
  {
    label: "水尺数",
    prop: "DRAFT2",
    // minwidth: "90",
  },
  {
    label: "皮带秤数",
    prop: "PDC",
    // minwidth: "90",
  }
];
const zycolumns = [
  {
    label: "流程",
    prop: "FLOWID",
  },
  {
    label: "开始时间",
    prop: "STARTTIME",
  },
  {
    label: "结束时间",
    prop: "ENDTIME",
  },
  {
    label: "作业量",
    prop: "DC3TON",
  },
  {
    label: "时长",
    prop: "DELAY",
  },
  {
    label: "说明",
    prop: "NOTE",
  }
];
const tgcolumns = [
  {
    label: "船名",
    prop: "SHIPNAME",
  },
  {
    label: "航次",
    prop: "VAYAGE",
  },
  {
    label: "出库类型",
    optionsdic: 'sys_czfs',
    prop: "OUTTYPE",
  },
  {
    label: "煤种",
    prop: "CARGOCODE",
    optionsdic: 'sys_cargo',
  },
  {
    label: "出库吨",
    prop: "TONS",
  },
];
// 挖坑
const shipcolumns = [
  {
    label: "日期",
    prop: "WORKDATE",
  },
  {
    label: "流机名称",
    prop: "MOVENAME",
  },
  {
    label: "作业地点",
    prop: "WORKPLACE",
  },
  {
    label: "作业内容",
    prop: "WORKCONTENT",
  },
];
export default {
  name: "Zxzl",
  props: {
    initAnchorInfo: {
      type: String,
      default: "xxxxxxxx",
    },
    cardstyle: {
      type: Object,
      default() {
        return {}
      },
    },
    title: {
      type: String,
      default() {
        return ""
      },
    },
    shipseq: {
      type: String,
      default() {
        return ""
      },
    },
  },
  data() {
    return {
      cardzbstyle: {
        backgroundColor: "#fff",
      },
      info: [],
      zyinfo: [],
      tginfo: [],
      fzinfo: [],
      shipinfo: [],
      columns,
      zycolumns,
      tgcolumns,
      shipcolumns,
      options: {},
    }
  },
  computed: {
    infoform() {
      return this.info[0] || {}
    }
  },
  mounted() {
    this.init()
  },
  methods: {
    init() {
      this.queryinfo()
    },
    // 查询船舶基本信息
    queryinfo() {
      this.$api.summary.JK_SHIP_ZLINFO({ shipseq: this.shipseq }).then((val) => {
        this.info = val.zmap
        this.zyinfo = val.zlxs
        this.tginfo = val.ckjl
        this.shipinfo = val.wkjl
      })
    },
  }
}
</script>

<style lang="scss" scoped>
.zy_title{
  text-align: center;
  font-size: 17px;
}
</style>
